package com.example.oop;

import java.util.concurrent.atomic.AtomicInteger;

/**
 * @author houyangfan
 * @version 1.0
 * @date 2022/8/2 18:25
 */
public class FanxingParent<T> {

    private T value;

    AtomicInteger updateCount  = new AtomicInteger();

    public void setValue(T value){
        this.value = value;
        System.out.println("Parent.setValue called");
        updateCount.incrementAndGet();
    }

    @Override
    public String toString() {
        return String.format("value: %s updateCount: %d", value, updateCount.get());
    }
}
